package com.hue.gulimail.gulimailthire.controller;

import com.hue.common.to.CheckCodeTo;
import com.hue.common.utils.R;
import com.hue.gulimail.gulimailthire.utils.EmailUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 姚凤桥
 * @Date 2021/11/24 16:58
 * @Description:
 */
@RestController
@RequestMapping("/email")
public class EmailController {
    @Autowired
    private EmailUtils emailUtils;

    @PostMapping("/sendEmail")
    public R sendEmail(@RequestBody CheckCodeTo checkCodeTo) {
        emailUtils.sendEmail(checkCodeTo.getTarget(), checkCodeTo.getTitle(), checkCodeTo.getText());
        return R.ok();
    }
}
